package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.SchMajorMapper;
import com.ruoyi.teach.domain.SchMajor;
import com.ruoyi.teach.service.ISchMajorService;

/**
 * 专业Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class SchMajorServiceImpl implements ISchMajorService 
{
    @Autowired
    private SchMajorMapper schMajorMapper;

    /**
     * 查询专业
     * 
     * @param mId 专业主键
     * @return 专业
     */
    @Override
    public SchMajor selectSchMajorByMId(Long mId)
    {
        return schMajorMapper.selectSchMajorByMId(mId);
    }

    /**
     * 查询专业列表
     * 
     * @param schMajor 专业
     * @return 专业
     */
    @Override
    public List<SchMajor> selectSchMajorList(SchMajor schMajor)
    {
        return schMajorMapper.selectSchMajorList(schMajor);
    }

    /**
     * 新增专业
     * 
     * @param schMajor 专业
     * @return 结果
     */
    @Override
    public int insertSchMajor(SchMajor schMajor)
    {
        schMajor.setCreateTime(DateUtils.getNowDate());
        return schMajorMapper.insertSchMajor(schMajor);
    }

    /**
     * 修改专业
     * 
     * @param schMajor 专业
     * @return 结果
     */
    @Override
    public int updateSchMajor(SchMajor schMajor)
    {
        schMajor.setUpdateTime(DateUtils.getNowDate());
        return schMajorMapper.updateSchMajor(schMajor);
    }

    /**
     * 批量删除专业
     * 
     * @param mIds 需要删除的专业主键
     * @return 结果
     */
    @Override
    public int deleteSchMajorByMIds(Long[] mIds)
    {
        return schMajorMapper.deleteSchMajorByMIds(mIds);
    }

    /**
     * 删除专业信息
     * 
     * @param mId 专业主键
     * @return 结果
     */
    @Override
    public int deleteSchMajorByMId(Long mId)
    {
        return schMajorMapper.deleteSchMajorByMId(mId);
    }
}
